package com.startech.controller;


import com.startech.common.domain.vo.Result;
import com.startech.domain.User;
import com.startech.dto.LoginDto;
import com.startech.dto.RegisterDto;
import com.startech.service.IUserInfoService;
import com.startech.service.IUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author startech
 * @since 2025-07-17
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/user")
public class UserController {
    private final IUserService userService;


    @PostMapping("/register")
    public Result register(@RequestBody RegisterDto registerDto) {

        userService.register(registerDto);
        return Result.success();
    }
    @PostMapping("/login")
    public Result login(@RequestBody LoginDto loginDto) {
        userService.login(loginDto);

        return Result.success();
    }
}
